# Based on Arch's uusi package
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=uusi
pkgver=0.4.3
pkgrel=0
pkgdesc="Tweak cabal package descriptions"
url="https://github.com/berberman/uusi"
arch="aarch64 x86_64" # ghc
license="MIT"
makedepends="ghc"
subpackages="$pkgname-doc"
source="https://github.com/berberman/uusi/archive/$pkgver/uusi-$pkgver.tar.gz"
options="!check" # needs HUnit package

build() {
	runhaskell Setup configure -O \
		--enable-shared \
		--enable-executable-dynamic \
		--disable-library-vanilla \
		--prefix=/usr \
		--docdir=/usr/share/licenses/$pkgname \
		--datasubdir=$pkgname \
		--disable-tests \
		--dynlibdir=/usr/lib \
		--libsubdir=\$compiler/site-local/\$pkgid \
		--ghc-option=-fllvm \
		--ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
		--ghc-option='-pie'

	runhaskell Setup build
}

package() {
	runhaskell Setup copy --destdir="$pkgdir"
}

sha512sums="
12ea510341face022ce51a39f10a85c620446daa29170618c0421746dccd9c726837a8309a01bf9b326186a03a508baed5213cf01d5dcb1bf9b35f40adbadaf2  uusi-0.4.3.tar.gz
"
